package com.yunshan.mp.service.impl;

import com.yunshan.common.utils.DateUtils;
import com.yunshan.mp.domain.MpIndexIntroduction;
import com.yunshan.mp.mapper.MpIndexIntroductionMapper;
import com.yunshan.mp.service.IMpIndexIntroductionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 会所简介Service业务层处理
 * 
 * @author yunshan
 * @date 2025-01-20
 */
@Service
public class MpIndexIntroductionServiceImpl implements IMpIndexIntroductionService 
{
    @Autowired
    private MpIndexIntroductionMapper mpIndexIntroductionMapper;

    /**
     * 查询会所简介
     * 
     * @param id 会所简介主键
     * @return 会所简介
     */
    @Override
    public MpIndexIntroduction selectMpIndexIntroductionById(Long id)
    {
        return mpIndexIntroductionMapper.selectMpIndexIntroductionById(id);
    }

    /**
     * 查询会所简介列表
     * 
     * @param mpIndexIntroduction 会所简介
     * @return 会所简介
     */
    @Override
    public List<MpIndexIntroduction> selectMpIndexIntroductionList(MpIndexIntroduction mpIndexIntroduction)
    {
        return mpIndexIntroductionMapper.selectMpIndexIntroductionList(mpIndexIntroduction);
    }

    /**
     * 新增会所简介
     * 
     * @param mpIndexIntroduction 会所简介
     * @return 结果
     */
    @Override
    public int insertMpIndexIntroduction(MpIndexIntroduction mpIndexIntroduction)
    {
        mpIndexIntroduction.setCreateTime(DateUtils.getNowDate());
        return mpIndexIntroductionMapper.insertMpIndexIntroduction(mpIndexIntroduction);
    }

    /**
     * 修改会所简介
     * 
     * @param mpIndexIntroduction 会所简介
     * @return 结果
     */
    @Override
    public int updateMpIndexIntroduction(MpIndexIntroduction mpIndexIntroduction)
    {
        mpIndexIntroduction.setUpdateTime(DateUtils.getNowDate());
        return mpIndexIntroductionMapper.updateMpIndexIntroduction(mpIndexIntroduction);
    }

    /**
     * 批量删除会所简介
     * 
     * @param ids 需要删除的会所简介主键
     * @return 结果
     */
    @Override
    public int deleteMpIndexIntroductionByIds(Long[] ids)
    {
        return mpIndexIntroductionMapper.deleteMpIndexIntroductionByIds(ids);
    }

    /**
     * 删除会所简介信息
     * 
     * @param id 会所简介主键
     * @return 结果
     */
    @Override
    public int deleteMpIndexIntroductionById(Long id)
    {
        return mpIndexIntroductionMapper.deleteMpIndexIntroductionById(id);
    }

    @Override
    public MpIndexIntroduction selectUniInfo() {
        return mpIndexIntroductionMapper.selectUniInfo();
    }
}
